<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SPRING MVC AJAX DEMO</title>
<script src="js/jquery-1.4.3.js"></script>
<script>
	$(function(){
		$('#ary-btn').click(aryDemo);		
	});
	
	function aryDemo(){
	/* 	console.log('click()'); */
		$.ajax({
			url:'demo/arr.do',
			type:'get',
			dataType:'json',
			success:function(arr){
				console.log(arr);
				
				
				
				for(var i=0;i<arr.length;i++){
					
					$('#ary-result').append(arr[i]);
					
					
				}
				
				
				
				
				
			},
			error:function(){
				alert('通信故障');
				
				
			}
			
		});
		
	
	
	
	}
	

</script>

</head>
<body>
	<h1>SPRING MVC SAJX</h1>	
	<h2>获取服务器数组数据</h2>
	<input type="button" id="ary-btn" value="数组"/>
	<p id="ary-result"></p>	
	

</body>
</html>





















